﻿@model IEnumerable<Data.ViewModels.PerguntaViewModel>
@using CantinhodaCegonha.Models.Helpers

@foreach (var item in Model)
{         
<div id="question-summary-@item.Id" class="question-summary narrow">
    <div class="cp" onclick="window.location.href='@Url.Action("Details", "Pergunta", new { id = item.Id })'">
        <div class="votes">
            <div class="mini-counts">@item.Votes</div>
            <div>votos</div>
        </div>
        <div class="status @(item.Answers > 0 ? "answered" : "unanswered")">
            <div class="mini-counts">@item.Answers</div>
            <div>respostas</div>
        </div>
        <div class="views">
            <div class="mini-counts">@item.Views</div>
            <div>visitas</div>
        </div>
    </div>
    <div class="summary">
        <h3><a title="@Html.TruncateText(item.Body, 50)" class="question-hyperlink" href="@Url.Action("Details", "Pergunta", new { id = item.Id })">@item.Title</a></h3>
        <div class="tags">
            @foreach (var tag in item.Tags)
            {
                @Html.ActionLink(tag.TagName,"Tagged","Pergunta",new {id = tag.TagName},new {@class ="post-tag",title ="Mostrar perguntas com a palavra chave '"+tag.TagName+"'",rel="tag"})
               
            }
        </div>
        <div class="started">
            <a class="started-link" href="@Url.Action("Details", "Pergunta", new { id = item.Id })#@item.Id"><span class="relativetime" title="@item.LastUpdateDate">@item.LastUpdateDateFormated</span></a>
            @Html.ActionLink(item.LastUpdateUser.Nome, "UserDetails", "Account", new { id = item.LastUpdateUser.Id },null) <span title="reputation score" class="reputation-score">@if(item.LastUpdateUser.Ponto == null){<text>0</text> }else{@item.LastUpdateUser.Ponto.Total}</span>
        </div>
    </div>
</div>
}
@if (ViewData["moreUrl"] != null)
{
    <a href='@ViewData["moreUrl"]' id="moreLink" class="necessariologin" style=" float: left; margin-top: 30px; width: 100%; color: #59890C;">Mostrar mais perguntas</a>
}
